﻿using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using UnityEngine;
using UnityEditor;
using Utility;

public class InternalResources : ScriptableObject
{
	static InternalResources _inst;
	public static InternalResources Inst
	{
		get
		{
			if (_inst == null)
			{
#if UNITY_EDITOR
				var objs = AssetDatabase.FindAssets ("t:InternalResources");
				if (objs.Length <= 0)
				{
					_inst = CreateInstance<InternalResources> ();
					AssetDatabase.CreateAsset (_inst, "Assets/Resources/InternalResources.asset");
				}
				else
				{
					string path = AssetDatabase.GUIDToAssetPath (objs[0]);
					_inst = AssetDatabase.LoadAssetAtPath<InternalResources> (path);
				}
#else
				_inst = Resources.LoadAll<InternalResources> ("")[0];
#endif
			}
			return _inst;
		}
	}

	[RuntimeInitializeOnLoadMethod]
	void Register ()
	{
		_inst = this;
	}

	//war fog
	public GameObject warFog;
	public static GameObject WarFog => Inst.warFog;

	public List<GameObject> warFog_List = new List<GameObject> ();
	public static List<GameObject> WarFog_List => Inst.warFog_List;
}
